\(\int (a+a \sec (c+d x))^4 \, dx\) [33]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 12, antiderivative size = 91 \[ \int (a+a \sec (c+d x))^4 \, dx=a^4 x+\frac {6 a^4 \text {arctanh}(\sin (c+d x))}{d}+\frac {5 a^4 \tan (c+d x)}{d}+\frac {\left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{3 d}+\frac {4 \left (a^4+a^4 \sec (c+d x)\right ) \tan (c+d x)}{3 d} \]

[Out]

a^4*x+6*a^4*arctanh(sin(d*x+c))/d+5*a^4*tan(d*x+c)/d+1/3*(a^2+a^2*sec(d*x+c))^2*tan(d*x+c)/d+4/3*(a^4+a^4*sec(
d*x+c))*tan(d*x+c)/d

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3860, 4002, 3999, 3852, 8, 3855} \[ \int (a+a \sec (c+d x))^4 \, dx=\frac {6 a^4 \text {arctanh}(\sin (c+d x))}{d}+\frac {5 a^4 \tan (c+d x)}{d}+\frac {4 \tan (c+d x) \left (a^4 \sec (c+d x)+a^4\right )}{3 d}+a^4 x+\frac {\tan (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{3 d} \]

[In]

Int[(a + a*Sec[c + d*x])^4,x]

[Out]

a^4*x + (6*a^4*ArcTanh[Sin[c + d*x]])/d + (5*a^4*Tan[c + d*x])/d + ((a^2 + a^2*Sec[c + d*x])^2*Tan[c + d*x])/(
3*d) + (4*(a^4 + a^4*Sec[c + d*x])*Tan[c + d*x])/(3*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3860

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Simp[(-b^2)*Cot[c + d*x]*((a + b*Csc[c + d*x])^(
n - 2)/(d*(n - 1))), x] + Dist[a/(n - 1), Int[(a + b*Csc[c + d*x])^(n - 2)*(a*(n - 1) + b*(3*n - 4)*Csc[c + d*
x]), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0] && GtQ[n, 1] && IntegerQ[2*n]

Rule 3999

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_)), x_Symbol] :> Simp[a*c*x, x]
 + (Dist[b*d, Int[Csc[e + f*x]^2, x], x] + Dist[b*c + a*d, Int[Csc[e + f*x], x], x]) /; FreeQ[{a, b, c, d, e,
f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 4002

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_)), x_Symbol] :> Simp[(-b)
*d*Cot[e + f*x]*((a + b*Csc[e + f*x])^(m - 1)/(f*m)), x] + Dist[1/m, Int[(a + b*Csc[e + f*x])^(m - 1)*Simp[a*c
*m + (b*c*m + a*d*(2*m - 1))*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] &&
GtQ[m, 1] && EqQ[a^2 - b^2, 0] && IntegerQ[2*m]

Rubi steps \begin{align*} \text {integral}& = \frac {\left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{3 d}+\frac {1}{3} a \int (a+a \sec (c+d x))^2 (3 a+8 a \sec (c+d x)) \, dx \\ & = \frac {\left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{3 d}+\frac {4 \left (a^4+a^4 \sec (c+d x)\right ) \tan (c+d x)}{3 d}+\frac {1}{6} a \int (a+a \sec (c+d x)) \left (6 a^2+30 a^2 \sec (c+d x)\right ) \, dx \\ & = a^4 x+\frac {\left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{3 d}+\frac {4 \left (a^4+a^4 \sec (c+d x)\right ) \tan (c+d x)}{3 d}+\left (5 a^4\right ) \int \sec ^2(c+d x) \, dx+\left (6 a^4\right ) \int \sec (c+d x) \, dx \\ & = a^4 x+\frac {6 a^4 \text {arctanh}(\sin (c+d x))}{d}+\frac {\left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{3 d}+\frac {4 \left (a^4+a^4 \sec (c+d x)\right ) \tan (c+d x)}{3 d}-\frac {\left (5 a^4\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{d} \\ & = a^4 x+\frac {6 a^4 \text {arctanh}(\sin (c+d x))}{d}+\frac {5 a^4 \tan (c+d x)}{d}+\frac {\left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{3 d}+\frac {4 \left (a^4+a^4 \sec (c+d x)\right ) \tan (c+d x)}{3 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 2.12 (sec) , antiderivative size = 73, normalized size of antiderivative = 0.80 \[ \int (a+a \sec (c+d x))^4 \, dx=a^4 x+\frac {6 a^4 \text {arctanh}(\sin (c+d x))}{d}+\frac {7 a^4 \tan (c+d x)}{d}+\frac {2 a^4 \sec (c+d x) \tan (c+d x)}{d}+\frac {a^4 \tan ^3(c+d x)}{3 d} \]

[In]

Integrate[(a + a*Sec[c + d*x])^4,x]

[Out]

a^4*x + (6*a^4*ArcTanh[Sin[c + d*x]])/d + (7*a^4*Tan[c + d*x])/d + (2*a^4*Sec[c + d*x]*Tan[c + d*x])/d + (a^4*
Tan[c + d*x]^3)/(3*d)

Maple [A] (verified)

Time = 0.66 (sec) , antiderivative size = 89, normalized size of antiderivative = 0.98

method result size
parts \(a^{4} x -\frac {a^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}+\frac {6 a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {6 a^{4} \tan \left (d x +c \right )}{d}+\frac {2 a^{4} \sec \left (d x +c \right ) \tan \left (d x +c \right )}{d}\) \(89\)
derivativedivides \(\frac {-a^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+4 a^{4} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+6 a^{4} \tan \left (d x +c \right )+4 a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{4} \left (d x +c \right )}{d}\) \(104\)
default \(\frac {-a^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+4 a^{4} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+6 a^{4} \tan \left (d x +c \right )+4 a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{4} \left (d x +c \right )}{d}\) \(104\)
risch \(a^{4} x -\frac {4 i a^{4} \left (3 \,{\mathrm e}^{5 i \left (d x +c \right )}-9 \,{\mathrm e}^{4 i \left (d x +c \right )}-21 \,{\mathrm e}^{2 i \left (d x +c \right )}-3 \,{\mathrm e}^{i \left (d x +c \right )}-10\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}+\frac {6 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {6 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}\) \(117\)
parallelrisch \(-\frac {18 a^{4} \left (\left (\cos \left (d x +c \right )+\frac {\cos \left (3 d x +3 c \right )}{3}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+\left (-\cos \left (d x +c \right )-\frac {\cos \left (3 d x +3 c \right )}{3}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-\frac {d x \cos \left (d x +c \right )}{6}-\frac {d x \cos \left (3 d x +3 c \right )}{18}-\frac {4 \sin \left (d x +c \right )}{9}-\frac {2 \sin \left (2 d x +2 c \right )}{9}-\frac {10 \sin \left (3 d x +3 c \right )}{27}\right )}{d \left (\cos \left (3 d x +3 c \right )+3 \cos \left (d x +c \right )\right )}\) \(147\)
norman \(\frac {a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}-a^{4} x -\frac {18 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {76 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 d}-\frac {10 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}+3 a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-3 a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{\left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}-\frac {6 a^{4} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}+\frac {6 a^{4} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}\) \(170\)

[In]

int((a+a*sec(d*x+c))^4,x,method=_RETURNVERBOSE)

[Out]

a^4*x-a^4/d*(-2/3-1/3*sec(d*x+c)^2)*tan(d*x+c)+6*a^4/d*ln(sec(d*x+c)+tan(d*x+c))+6*a^4*tan(d*x+c)/d+2*a^4*sec(
d*x+c)*tan(d*x+c)/d

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.21 \[ \int (a+a \sec (c+d x))^4 \, dx=\frac {3 \, a^{4} d x \cos \left (d x + c\right )^{3} + 9 \, a^{4} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 9 \, a^{4} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + {\left (20 \, a^{4} \cos \left (d x + c\right )^{2} + 6 \, a^{4} \cos \left (d x + c\right ) + a^{4}\right )} \sin \left (d x + c\right )}{3 \, d \cos \left (d x + c\right )^{3}} \]

[In]

integrate((a+a*sec(d*x+c))^4,x, algorithm="fricas")

[Out]

1/3*(3*a^4*d*x*cos(d*x + c)^3 + 9*a^4*cos(d*x + c)^3*log(sin(d*x + c) + 1) - 9*a^4*cos(d*x + c)^3*log(-sin(d*x
 + c) + 1) + (20*a^4*cos(d*x + c)^2 + 6*a^4*cos(d*x + c) + a^4)*sin(d*x + c))/(d*cos(d*x + c)^3)

Sympy [F]

\[ \int (a+a \sec (c+d x))^4 \, dx=a^{4} \left (\int 1\, dx + \int 4 \sec {\left (c + d x \right )}\, dx + \int 6 \sec ^{2}{\left (c + d x \right )}\, dx + \int 4 \sec ^{3}{\left (c + d x \right )}\, dx + \int \sec ^{4}{\left (c + d x \right )}\, dx\right ) \]

[In]

integrate((a+a*sec(d*x+c))**4,x)

[Out]

a**4*(Integral(1, x) + Integral(4*sec(c + d*x), x) + Integral(6*sec(c + d*x)**2, x) + Integral(4*sec(c + d*x)*
*3, x) + Integral(sec(c + d*x)**4, x))

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.27 \[ \int (a+a \sec (c+d x))^4 \, dx=a^{4} x + \frac {{\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} a^{4}}{3 \, d} - \frac {a^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{d} + \frac {4 \, a^{4} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right )}{d} + \frac {6 \, a^{4} \tan \left (d x + c\right )}{d} \]

[In]

integrate((a+a*sec(d*x+c))^4,x, algorithm="maxima")

[Out]

a^4*x + 1/3*(tan(d*x + c)^3 + 3*tan(d*x + c))*a^4/d - a^4*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x +
 c) + 1) + log(sin(d*x + c) - 1))/d + 4*a^4*log(sec(d*x + c) + tan(d*x + c))/d + 6*a^4*tan(d*x + c)/d

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.27 \[ \int (a+a \sec (c+d x))^4 \, dx=\frac {3 \, {\left (d x + c\right )} a^{4} + 18 \, a^{4} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 18 \, a^{4} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (15 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 38 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 27 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{3 \, d} \]

[In]

integrate((a+a*sec(d*x+c))^4,x, algorithm="giac")

[Out]

1/3*(3*(d*x + c)*a^4 + 18*a^4*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 18*a^4*log(abs(tan(1/2*d*x + 1/2*c) - 1)) -
 2*(15*a^4*tan(1/2*d*x + 1/2*c)^5 - 38*a^4*tan(1/2*d*x + 1/2*c)^3 + 27*a^4*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x
+ 1/2*c)^2 - 1)^3)/d

Mupad [B] (verification not implemented)

Time = 13.51 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.29 \[ \int (a+a \sec (c+d x))^4 \, dx=a^4\,x+\frac {12\,a^4\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {10\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5-\frac {76\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{3}+18\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \]

[In]

int((a + a/cos(c + d*x))^4,x)

[Out]

a^4*x + (12*a^4*atanh(tan(c/2 + (d*x)/2)))/d - (10*a^4*tan(c/2 + (d*x)/2)^5 - (76*a^4*tan(c/2 + (d*x)/2)^3)/3
+ 18*a^4*tan(c/2 + (d*x)/2))/(d*(3*tan(c/2 + (d*x)/2)^2 - 3*tan(c/2 + (d*x)/2)^4 + tan(c/2 + (d*x)/2)^6 - 1))